Build report: structured JSON report with per-mojo log capture - #12695
Draft
gnodet wants to merge 2 commits into
Draft
Build report: structured JSON report with per-mojo log capture#12695gnodet wants to merge 2 commits into
gnodet wants to merge 2 commits into
Conversation
This was referenced Aug 7, 2026
gnodet
force-pushed
the
feature/logging-foundation
branch
from
August 8, 2026 01:19
bae1db9 to
5a5af1e
Compare
gnodet
force-pushed
the
feature/build-report
branch
from
August 8, 2026 01:23
602fffb to
056dcf0
Compare
gnodet
added a commit
that referenced
this pull request
Aug 8, 2026
Add the --console CLI flag with four output modes: - plain: compact one-line-per-module output for CI - rich: JLine status bar with live reactor progress - verbose: full mojo-level output (current default) - machine: JSON lines for piping to external tools Part 3 of the #12572 split (depends on build report PR #12695). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This was referenced Aug 8, 2026
Add a structured build report that captures per-module and per-mojo execution results, timing, log events, and failures as a JSON file (target/build-reports/) at the end of every build. Part 2 of the #12572 split. Builds on the logging foundation from PR #12694 (LogEvent, LogLevel, LogEventSink). New API interfaces: - BuildReport: root report with metadata, modules, failures, problems - BuildStatus: SUCCESS/FAILURE/SKIPPED enum - ModuleReport: per-module results with mojo list - MojoReport: per-mojo execution with captured log events - FailureReport: exception details and stack traces Implementation: - BuildReportCollector: EventSpy that tracks lifecycle events and captures log output via LogEventSink, routing events to mojo/module/build-level buffers using thread-based tracking - BuildReportJsonWriter: zero-dependency JSON serializer - Atomic file writes with timestamped files and latest symlink - Thread-safe for parallel builds (-T) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…in build report JSON LogEvents from java.util.logging now include their source class name, source method name, and thread ID in the JSON report when present. Non-JUL events (from SLF4J/Log API) omit these fields. Also adds writeField(long) overload and removeTrailingComma() helper to simplify JSON serialization of optional trailing fields. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
gnodet
force-pushed
the
feature/build-report
branch
from
August 8, 2026 05:35
056dcf0 to
a1ee585
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Part 2 of the logging feature chain (depends on #12694 — logging foundation).
Adds a structured build report that captures per-module and per-mojo execution results, timing, log events, and failures as a JSON file at the end of every build.
15 files changed, ~2700 insertions — focused on report data model, collection, and serialization.
What's in this PR
BuildReport,BuildStatus,ModuleReport,MojoReport,FailureReportDefaultBuildReport,DefaultModuleReport,DefaultMojoReport,DefaultFailureReportBuildReportCollectorEventSpythat tracks lifecycle events and captures log output viaLogEventSink, routing to mojo/module/build-level buffersBuildReportJsonWriterKey design decisions
BuildReportCollectoris a@Named @Singletonthat extendsAbstractEventSpy, discovered automatically — no wiring changes neededConcurrentHashMap<Long, String>(thread ID → mojo/project key) to associate log events with the correct scope in parallel buildsLogEventSink(4-arg) independently from the existingLogSink(5-arg) used byProjectBuildLogAppender— no interference with console outputbuild-report-latest.jsonsymlinkonSessionEndedwraps report generation in try-catch so report failures never crash the buildWhat's NOT in this PR (deferred to later PRs)
--warning-modeCLI flag — Warning mode, diagnostic collector, BuilderProblem enrichments #12698--console=plain/rich/machine) — Console modes: --console=plain/rich/verbose/machine #12697mvnlogviewer tool — mvnlog: build log viewer, integration tests, script routing #12699PR chain
mvnlogviewerTest plan
🤖 Generated with Claude Code